An operator is a symbol that tells the compiler to perform a specific mathematical or logical operation. C + + has a rich operator built into it and provides the following types of operators:
Arithmetic operators
Relational operators
The operands of predefined operators in C + + can only be basic data types, and in fact, for many user-defined types, similar operations are Required. For example:Class Complex{PublicComplex (double r=0.0,double i=0.0) {real=r;imag=i;}void Display ()
C-language operator precedence and formulasThere are 15 priority levels: operators of the same precedence, and the order of operations is determined by the binding direction1 () []. --(parentheses, member row first)2! ~-(minus) + +--& (take variable
One, C # operator PrecedenceThe C # operator is also known as C # operators.When an expression contains more than one operator, the order of operations for the operator occurs. In C #, the precedence of operators is used to solve the order of
Reproduced in: http://www.jb51.net/article/37282.htmWhenever you want to find which operator priority high, many times always want to find no, really let people angry! Now, finally have a I personally feel very full of, share to everyone, welcome to
Precedence
Operator
Description
Example
associativity
1
()[]-.::++--
Grouping operatorArray AccessMember access from a pointerMember access from a objectScoping operatorPost-incrementPost-decrement
(A
Priority level
operator
description
examples
of associativity
1
()[]-.::++--
The parentheses operator that adjusts the precedenceArray Subscript access operatorTo access a member's operator by
Back to the C language, feel that the combination of C language operators it is necessary to mention, after all, last year I just learned the C language, I did not understand the problem of integration.
What is left binding. What is the right
Priority level
Operator
Name or meaning
Use form
Combination direction
Description
1
Rear-facing + +
Post-increment operator
Variable name + +
Left to right
Rear--
Whenever you want to find which operator priority high, many times always want to find no, really let people angry! Now, finally have a I personally feel very full of, share to everyone, welcome to shoot Bricks!C-language operator precedence
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.